<template>
  <div id="app">
    <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> |
      <router-link to="/com">组件</router-link> |
      <router-link :to="{path:'/watch',query:{name:'q'}}">监听器</router-link> |
      <router-link to="/admin">后台</router-link> |
    </div>
    <router-view/>
  </div>
</template>
<script>
export default {
  watch: {
    /* JS中对象的key的值如果不符合js的命名规范，则必须使用引号包括 */
    '$route.path': function (obj) {
      console.log('watched')
      console.log(obj)
    }
  }
}
</script>
<style lang="scss">

</style>
